﻿function editCustomer(id) {
    window.location = "/Customer/Edit?id=" + id;
}

function deleteCustomer(id) {
    window.location = "/Customer/Edit?id=" + id;
}

function editContentItem(type, id) {
    window.location = "/Content/Edit?type=" + type + "&id=" + id;
}

function customerSaved() {
    alert("Customer saved successfully");
}

function deleteCustomer(id) {
    confirm("Are you sure you want to delete this customer?", "deleteCustomerAux(" + id + ")");
}

function deleteCustomerAux(id) {
    $.ajax({
        type: "POST",
        url: appPath + "Customer/Delete",
        data: { Id: id },
        success: function (result) {
            if (result.error) {
                error(result.error);
            }
            else {
                CustomGrid_LiteRefresh("CustomerGrid");
                info("Customer Deleted");
            }
        },
        async: false
    });
}